#ifndef __HELICOPTER_H__
#define __HELICOPTER_H__

#include "sceneObject.h"
#include "thread.h"
#include "clamp.h"
#include <utility>

class Helicopter : public SceneObject{
	public:
		typedef enum{ LEFT=-1,RIGHT=1 } MotionVectorX;
		typedef enum{ UP=-1,DOWN=1 } MotionVectorY;

	private:
        bool stateChange;
        float theta;

        static const float accelx;
        static const float accely;
        static const float maxSpeedx;
        static const float maxSpeedy;
        static const float rotationAngle;

		float speedy;

	public:
        Helicopter(Rectangle recSkin, Rectangle recThread,Rectangle recClamp);
		~Helicopter();

		virtual void draw();
		virtual void timeStep();

		void accelerateX(MotionVectorX dir);
		void accelerateY(MotionVectorY dir);

		void closeClamp();
		void openClamp();

		void moveClamp(Thread::MotionVector dir);

        void stopX(){
            this->speed=0;
            this->theta=0;
        }

        void stopY(){
            this->speedy=0;
        }

        float getSpeedy(){return speedy;}

		Clamp& getClamp(){
			return dynamic_cast<Clamp&>(this->findObject(Thread::name()).findObject(Clamp::name()));
		}

		void move(float dx,float dy);

		static std::string name(){
			return "helicopter";
		}
};

#endif /* __HELICOPTER_H__ */



